#include <stdio.h>  
#include <string.h>  
  
int main() {  
    char s[105];  
    int num;  
    FILE *f;  
    gets(s);  
    scanf("%d", &num);  
    if ((f = fopen(s, "r")) == NULL) {  
        printf("File Name Error.\n");  
        return 0;  
    }  
    for (int i = 0; i < num; i++) {  
        if (fgets(s, 30, f) == NULL) {  
            printf("Line No Error.\n");  
            return ;  
        }  
    }  
    printf("%s", s);  
    fclose(f);  
    return 0;  
}  